package com.lg.cms.utils;

import com.lg.cms.entity.SuperUser;
import com.lg.cms.entity.User;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;


/**
 * @Description: cms
 * @Author: wuyuhang
 * @create: 2020-10-08 17:59
 */
public class SubjectUtil {
    /**
     * 获取登录的超级用户
     * @return
     */
    public static SuperUser getSuperUser(){
        return(SuperUser) SecurityUtils.getSubject().getPrincipal();
    }

    /**
     * 获取登录的普通用户
     * @return
     */
    public static User getUser(){
        return(User) SecurityUtils.getSubject().getPrincipal();
    }
}